package com.lys.java8.lambdaSample;

interface Eatable{
	void taste();
}

interface Flyable{
	void fly(String weather);
}

interface Addable{
	int add(int a, int b);
}
public class LambdaQs {

	public void eat(Eatable e) {
		System.out.println(e);
		e.taste();
	}
	
	public void drive(Flyable f) {
		System.out.println("i'm driving: " + f);
		f.fly("good day weather");
	}
	
	public void test(Addable addable) {
		System.out.println("5 + 3 = " + addable.add(5, 3));
	}
	
	public static void main(String[] args) {
		
		Eatable eat = () -> {
			System.out.println("abc");
		};
		eat.taste();
		
//		LambdaQs lq = new LambdaQs();
		
//		lq.eat(() -> System.out.println("taste good"));
//		lq.eat(new Eatable() {
//			@Override
//			public void taste() {
//				System.out.println("taste good");
//			}
//		});
//=================================================================
//		lq.drive(weather -> {
//			System.out.println("today weather is: " + weather);
//			System.out.println("fly good");
//		});
//		
//		lq.drive(new Flyable() {
//			@Override
//			public void fly(String weather) {
//				System.out.println("today weather is: " + weather);
//				System.out.println("fly good");
//			}
//		});
//=================================================================	
//		lq.test((a, b) -> a + b);
//		lq.test(new Addable() {
//			
//			@Override
//			public int add(int a, int b) {
//				return a + b;
//			}
//		});
	}

}
